package com.sinosoft.hydra.um.commons;

import com.sinosoft.hydra.um.domain.permission.SysOrganization;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 该类主要封装了对JDBC查询结果的封装
 * <p>仅限于jdbc查询部门表(sys_organization)使用
 * @version v0.5-alpha
 * @author <a href="mailto:oujianlin@sinux.com.cn">oujianlin@sinux.com.cn</a>
 *
 */
public class OrganizationRowMapper implements RowMapper<SysOrganization> {
    public SysOrganization mapRow(ResultSet rs, int rowNum) throws SQLException {
        SysOrganization org = new SysOrganization();
        org.setId(rs.getString("id"));
        org.setOrgName(rs.getString("orgName"));
        org.setParentId(rs.getString("parentId"));
        org.setOrderNo(rs.getInt("orderNo"));
        return org;
    }

}
